\(\int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx\) [1316]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 120 \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{a^3 d}+\frac {b \csc ^2(c+d x)}{2 a^2 d}-\frac {\csc ^3(c+d x)}{3 a d}+\frac {b \left (2 a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {\left (a^2-b^2\right )^2 \log (a+b \sin (c+d x))}{a^4 b d} \]

[Out]

(2*a^2-b^2)*csc(d*x+c)/a^3/d+1/2*b*csc(d*x+c)^2/a^2/d-1/3*csc(d*x+c)^3/a/d+b*(2*a^2-b^2)*ln(sin(d*x+c))/a^4/d+
(a^2-b^2)^2*ln(a+b*sin(d*x+c))/a^4/b/d

Rubi [A] (verified)

Time = 0.30 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2916, 12, 908} \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {b \csc ^2(c+d x)}{2 a^2 d}+\frac {b \left (2 a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {\left (a^2-b^2\right )^2 \log (a+b \sin (c+d x))}{a^4 b d}+\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{a^3 d}-\frac {\csc ^3(c+d x)}{3 a d} \]

[In]

Int[(Cos[c + d*x]*Cot[c + d*x]^4)/(a + b*Sin[c + d*x]),x]

[Out]

((2*a^2 - b^2)*Csc[c + d*x])/(a^3*d) + (b*Csc[c + d*x]^2)/(2*a^2*d) - Csc[c + d*x]^3/(3*a*d) + (b*(2*a^2 - b^2
)*Log[Sin[c + d*x]])/(a^4*d) + ((a^2 - b^2)^2*Log[a + b*Sin[c + d*x]])/(a^4*b*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b^4 \left (b^2-x^2\right )^2}{x^4 (a+x)} \, dx,x,b \sin (c+d x)\right )}{b^5 d} \\ & = \frac {\text {Subst}\left (\int \frac {\left (b^2-x^2\right )^2}{x^4 (a+x)} \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {b^4}{a x^4}-\frac {b^4}{a^2 x^3}+\frac {-2 a^2 b^2+b^4}{a^3 x^2}+\frac {2 a^2 b^2-b^4}{a^4 x}+\frac {\left (a^2-b^2\right )^2}{a^4 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b d} \\ & = \frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{a^3 d}+\frac {b \csc ^2(c+d x)}{2 a^2 d}-\frac {\csc ^3(c+d x)}{3 a d}+\frac {b \left (2 a^2-b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {\left (a^2-b^2\right )^2 \log (a+b \sin (c+d x))}{a^4 b d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.20 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.92 \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {6 a b \left (2 a^2-b^2\right ) \csc (c+d x)+3 a^2 b^2 \csc ^2(c+d x)-2 a^3 b \csc ^3(c+d x)-6 b^2 \left (-2 a^2+b^2\right ) \log (\sin (c+d x))+6 \left (a^2-b^2\right )^2 \log (a+b \sin (c+d x))}{6 a^4 b d} \]

[In]

Integrate[(Cos[c + d*x]*Cot[c + d*x]^4)/(a + b*Sin[c + d*x]),x]

[Out]

(6*a*b*(2*a^2 - b^2)*Csc[c + d*x] + 3*a^2*b^2*Csc[c + d*x]^2 - 2*a^3*b*Csc[c + d*x]^3 - 6*b^2*(-2*a^2 + b^2)*L
og[Sin[c + d*x]] + 6*(a^2 - b^2)^2*Log[a + b*Sin[c + d*x]])/(6*a^4*b*d)

Maple [A] (verified)

Time = 0.53 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.92

method result size
derivativedivides \(\frac {\frac {\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{4} b}-\frac {1}{3 a \sin \left (d x +c \right )^{3}}-\frac {-2 a^{2}+b^{2}}{a^{3} \sin \left (d x +c \right )}+\frac {\left (2 a^{2}-b^{2}\right ) b \ln \left (\sin \left (d x +c \right )\right )}{a^{4}}+\frac {b}{2 a^{2} \sin \left (d x +c \right )^{2}}}{d}\) \(111\)
default \(\frac {\frac {\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{4} b}-\frac {1}{3 a \sin \left (d x +c \right )^{3}}-\frac {-2 a^{2}+b^{2}}{a^{3} \sin \left (d x +c \right )}+\frac {\left (2 a^{2}-b^{2}\right ) b \ln \left (\sin \left (d x +c \right )\right )}{a^{4}}+\frac {b}{2 a^{2} \sin \left (d x +c \right )^{2}}}{d}\) \(111\)
parallelrisch \(\frac {24 \left (a -b \right )^{2} \left (a +b \right )^{2} \ln \left (2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )-24 \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{4}-b \left (\left (-48 a^{2} b +24 b^{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (a^{2} \left (\cot ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a b \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-21 a^{2}+12 b^{2}\right ) \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-3 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-21 a^{2}+12 b^{2}\right )\right ) a \right )}{24 a^{4} b d}\) \(201\)
norman \(\frac {-\frac {1}{24 a d}-\frac {\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )}{24 d a}+\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a^{2} d}+\frac {b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a^{2} d}+\frac {\left (5 a^{2}-3 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a^{3} d}+\frac {\left (5 a^{2}-3 b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a^{3} d}+\frac {\left (7 a^{2}-4 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a^{3} d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {b \left (2 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{4} d}+\frac {\left (a^{4}-2 a^{2} b^{2}+b^{4}\right ) \ln \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}{a^{4} b d}-\frac {\ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b d}\) \(289\)
risch \(-\frac {i x}{b}-\frac {2 i c}{b d}+\frac {2 i \left (6 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-8 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{i \left (d x +c \right )}-3 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}\right )}{3 d \,a^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{b d}-\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{a^{2} d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{a^{4} d}+\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{4} d}\) \(308\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)^4/(a+b*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*((a^4-2*a^2*b^2+b^4)/a^4/b*ln(a+b*sin(d*x+c))-1/3/a/sin(d*x+c)^3-(-2*a^2+b^2)/a^3/sin(d*x+c)+(2*a^2-b^2)/a
^4*b*ln(sin(d*x+c))+1/2/a^2*b/sin(d*x+c)^2)

Fricas [A] (verification not implemented)

none

Time = 0.49 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.65 \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {3 \, a^{2} b^{2} \sin \left (d x + c\right ) + 10 \, a^{3} b - 6 \, a b^{3} - 6 \, {\left (2 \, a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{2} + 6 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4} - {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) \sin \left (d x + c\right ) + 6 \, {\left (2 \, a^{2} b^{2} - b^{4} - {\left (2 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right )}{6 \, {\left (a^{4} b d \cos \left (d x + c\right )^{2} - a^{4} b d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4/(a+b*sin(d*x+c)),x, algorithm="fricas")

[Out]

-1/6*(3*a^2*b^2*sin(d*x + c) + 10*a^3*b - 6*a*b^3 - 6*(2*a^3*b - a*b^3)*cos(d*x + c)^2 + 6*(a^4 - 2*a^2*b^2 +
b^4 - (a^4 - 2*a^2*b^2 + b^4)*cos(d*x + c)^2)*log(b*sin(d*x + c) + a)*sin(d*x + c) + 6*(2*a^2*b^2 - b^4 - (2*a
^2*b^2 - b^4)*cos(d*x + c)^2)*log(1/2*sin(d*x + c))*sin(d*x + c))/((a^4*b*d*cos(d*x + c)^2 - a^4*b*d)*sin(d*x
+ c))

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)**4/(a+b*sin(d*x+c)),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.94 \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\frac {6 \, {\left (2 \, a^{2} b - b^{3}\right )} \log \left (\sin \left (d x + c\right )\right )}{a^{4}} + \frac {6 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{4} b} + \frac {3 \, a b \sin \left (d x + c\right ) + 6 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} - 2 \, a^{2}}{a^{3} \sin \left (d x + c\right )^{3}}}{6 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4/(a+b*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/6*(6*(2*a^2*b - b^3)*log(sin(d*x + c))/a^4 + 6*(a^4 - 2*a^2*b^2 + b^4)*log(b*sin(d*x + c) + a)/(a^4*b) + (3*
a*b*sin(d*x + c) + 6*(2*a^2 - b^2)*sin(d*x + c)^2 - 2*a^2)/(a^3*sin(d*x + c)^3))/d

Giac [A] (verification not implemented)

none

Time = 0.38 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.26 \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\frac {6 \, {\left (2 \, a^{2} b - b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{4}} + \frac {6 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{4} b} - \frac {22 \, a^{2} b \sin \left (d x + c\right )^{3} - 11 \, b^{3} \sin \left (d x + c\right )^{3} - 12 \, a^{3} \sin \left (d x + c\right )^{2} + 6 \, a b^{2} \sin \left (d x + c\right )^{2} - 3 \, a^{2} b \sin \left (d x + c\right ) + 2 \, a^{3}}{a^{4} \sin \left (d x + c\right )^{3}}}{6 \, d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^4/(a+b*sin(d*x+c)),x, algorithm="giac")

[Out]

1/6*(6*(2*a^2*b - b^3)*log(abs(sin(d*x + c)))/a^4 + 6*(a^4 - 2*a^2*b^2 + b^4)*log(abs(b*sin(d*x + c) + a))/(a^
4*b) - (22*a^2*b*sin(d*x + c)^3 - 11*b^3*sin(d*x + c)^3 - 12*a^3*sin(d*x + c)^2 + 6*a*b^2*sin(d*x + c)^2 - 3*a
^2*b*sin(d*x + c) + 2*a^3)/(a^4*sin(d*x + c)^3))/d

Mupad [B] (verification not implemented)

Time = 11.78 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.89 \[ \int \frac {\cos (c+d x) \cot ^4(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {7}{8\,a}-\frac {b^2}{2\,a^3}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a\,d}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{b\,d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a^2\,b-b^3\right )}{a^4\,d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a^2\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (7\,a^2-4\,b^2\right )-\frac {a^2}{3}+a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,a^3\,d\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}+\frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,{\left (a^2-b^2\right )}^2}{a^4\,b\,d} \]

[In]

int(cos(c + d*x)^5/(sin(c + d*x)^4*(a + b*sin(c + d*x))),x)

[Out]

(tan(c/2 + (d*x)/2)*(7/(8*a) - b^2/(2*a^3)))/d - tan(c/2 + (d*x)/2)^3/(24*a*d) - log(tan(c/2 + (d*x)/2)^2 + 1)
/(b*d) + (log(tan(c/2 + (d*x)/2))*(2*a^2*b - b^3))/(a^4*d) + (b*tan(c/2 + (d*x)/2)^2)/(8*a^2*d) + (tan(c/2 + (
d*x)/2)^2*(7*a^2 - 4*b^2) - a^2/3 + a*b*tan(c/2 + (d*x)/2))/(8*a^3*d*tan(c/2 + (d*x)/2)^3) + (log(a + 2*b*tan(
c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^2)*(a^2 - b^2)^2)/(a^4*b*d)